﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="BrowseMembers.aspx.vb" Inherits="helzwebscripting.BrowseMembers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Twilighters Community Members</h1>
    <asp:Button ID="btn_myProfile" runat="server" CssClass="myProfile_btn" 
        Text="My Profile" Height="30px" Width="126px" />
    <br /><br />
    <p>
        <br />
<%--REF TO CENTRE ALIGN A LISTVIEW: forums.asp.net/t/1736180.aspx/1--%>
        <table width="100%">
        <tr>
        <td align="center">
        <table>
        <tr>
        <td>

        <asp:ListView ID="listviewMembers" runat="server" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" GroupItemCount="3">
            <AlternatingItemTemplate>
                <td runat="server" style="background-color:#F2E9E9; color:#000000; text-align:center; padding: 10px;  width:150px; word-wrap:break-word;">
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <%# Eval("TwiWriter") %></a><br />   
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <img src='<%# Eval("Avatar") %>' alt="" width="80px" height="80px" /></a>
                <br />
                    <%# Eval("TwilighterName")%>
                </td>
                </td>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <td runat="server" style="">
                    TwilighterName:
                    <asp:TextBox ID="TwilighterNameTextBox" runat="server" 
                        Text='<%# Bind("TwilighterName") %>' />
                    <br />ID:
                    <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                    <br />Avatar:
                    <asp:TextBox ID="AvatarTextBox" runat="server" Text='<%# Bind("Avatar") %>' />
                    <br />Gender:
                    <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                    <br />Team:
                    <asp:TextBox ID="TeamTextBox" runat="server" Text='<%# Bind("Team") %>' />
                    <br />MyPicture:
                    <asp:TextBox ID="MyPictureTextBox" runat="server" 
                        Text='<%# Bind("MyPicture") %>' />
                    <br />AboutMe:
                    <asp:TextBox ID="AboutMeTextBox" runat="server" Text='<%# Bind("AboutMe") %>' />
                    <br />TwiWriter:
                    <asp:TextBox ID="TwiWriterTextBox" runat="server" 
                        Text='<%# Bind("TwiWriter") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <br />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                    <br />
                </td>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" style="">
                    <tr>
                        <td>
                            No data was returned.</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <EmptyItemTemplate>
        <td runat="server" />
            </EmptyItemTemplate>
            <GroupTemplate>
                <tr ID="itemPlaceholderContainer" runat="server">
                    <td ID="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </GroupTemplate>
            <InsertItemTemplate>
                <td runat="server" style="">
                    TwilighterName:
                    <asp:TextBox ID="TwilighterNameTextBox" runat="server" 
                        Text='<%# Bind("TwilighterName") %>' />
                    <br />Avatar:
                    <asp:TextBox ID="AvatarTextBox" runat="server" Text='<%# Bind("Avatar") %>' />
                    <br />Gender:
                    <asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
                    <br />Team:
                    <asp:TextBox ID="TeamTextBox" runat="server" Text='<%# Bind("Team") %>' />
                    <br />MyPicture:
                    <asp:TextBox ID="MyPictureTextBox" runat="server" 
                        Text='<%# Bind("MyPicture") %>' />
                    <br />AboutMe:
                    <asp:TextBox ID="AboutMeTextBox" runat="server" Text='<%# Bind("AboutMe") %>' />
                    <br />TwiWriter:
                    <asp:TextBox ID="TwiWriterTextBox" runat="server" 
                        Text='<%# Bind("TwiWriter") %>' />
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <br />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                    <br />
                </td>
            </InsertItemTemplate>
            <ItemTemplate>
                    <td id="Td1" runat="server" style="background-color:#F2E9E9; color: #000000; text-align:center; padding:10px; width:150px; word-wrap:break-word;">
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <%# Eval("TwiWriter") %></a><br />   
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <img src='<%# Eval("Avatar") %>' alt="" width="80px" height="80px" /></a>
                <br />
                    <%# Eval("TwilighterName")%>
                </td>
                </td>
                </td>
            </ItemTemplate>
            <LayoutTemplate>
                <table runat="server" class="membersPager">
                    <tr runat="server">
                        <td runat="server">
                            <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                                <tr ID="groupPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server">
                            <asp:DataPager ID="DataPager1" runat="server" PageSize="6">
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ButtonCssClass="pagerBtn" ShowFirstPageButton="True" 
                                        ShowLastPageButton="True" />
                                </Fields>
                            </asp:DataPager>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <td runat="server" style="">
                    TwilighterName:
                    <asp:Label ID="TwilighterNameLabel" runat="server" 
                        Text='<%# Eval("TwilighterName") %>' />
                    <br />ID:
                    <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                    <br />Avatar:
                    <asp:Label ID="AvatarLabel" runat="server" Text='<%# Eval("Avatar") %>' />
                    <br />Gender:
                    <asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' />
                    <br />Team:
                    <asp:Label ID="TeamLabel" runat="server" Text='<%# Eval("Team") %>' />
                    <br />MyPicture:
                    <asp:Label ID="MyPictureLabel" runat="server" Text='<%# Eval("MyPicture") %>' />
                    <br />AboutMe:
                    <asp:Label ID="AboutMeLabel" runat="server" Text='<%# Eval("AboutMe") %>' />
                    <br />TwiWriter:
                    <asp:Label ID="TwiWriterLabel" runat="server" Text='<%# Eval("TwiWriter") %>' />
                    <br />
                </td>
            </SelectedItemTemplate>
        </asp:ListView>

        </td>
        </tr>
        </table>
        </td>
        </tr>
        </table>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
            ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
            SelectCommand="SELECT [TwilighterName], [ID], [Avatar], [Gender], [Team], [MyPicture], [AboutMe], [TwiWriter] FROM [Profile]">
        </asp:SqlDataSource>
        <br />
    </p>
</asp:Content>
